package com.example.demo.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * Created by pengwan on 2017/6/29.
 */
@Configuration
@ConfigurationProperties(prefix = "datasources")
public class MultiDataSourceConfig {
    public static class DSConfig {
        private String name;
        private String driverClassName;
        private String username;
        private String password;
        private String url;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getDriverClassName() {
            return driverClassName;
        }

        public void setDriverClassName(String driverClassName) {
            this.driverClassName = driverClassName;
        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        public String getPassword() {
            return password;
        }

        public void setPassword(String password) {
            this.password = password;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }
    }


    private DSConfig[] dsConfigs;

    public DSConfig[] getDsConfigs() {
        return dsConfigs;
    }

    public void setDsConfigs(DSConfig[] dsConfigs) {
        this.dsConfigs = dsConfigs;
    }
}

